
        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">
            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">{$title}</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">
                                <form id="m_form"class="am-form tpl-form-line-form" method="post" action="{:U('center')}" enctype="multipart/form-data">

                                    <!--插图-->
                                    <include file="Public/img2" />

                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-2 am-form-label">内容</label>
                                        <div class="am-u-sm-10">
                                            <script name="info" id="editor" type="text/plain" style="width:100%;height:500px;">{$one.info} </script>
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <div  class="am-u-sm-10 am-u-sm-push-2">
                                            <input type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success">
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <script type="text/javascript" charset="utf-8" src="__PUBLIC__ueditor1_4_3_2-utf8-php/ueditor.config.js"></script>

        <script type="text/javascript" charset="utf-8" src="__PUBLIC__ueditor1_4_3_2-utf8-php/ueditor.all.min.js"> </script>
        <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
        <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
        <script type="text/javascript" charset="utf-8" src="__PUBLIC__ueditor1_4_3_2-utf8-php/lang/zh-cn/zh-cn.js"></script>
        <script type="text/javascript">

            //实例化编辑器
            //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
            var ue = UE.getEditor('editor');
        </script>
        <script>
            $(document).ready(function(){
                //数组去重
                function unique(data){
                    data = data || [];
                    var a = {};
                    len = data.length;
                    for (var i=0; i<len;i++){
                        var v = data[i];
                        if (typeof(a[v]) == 'undefined'){
                            a[v] = 1;
                        }
                    };
                    data.length=0;
                    for (var i in a){
                        data[data.length] = i;
                    }
                    return data;
                }

                function isAttrSame() {
                    var len = $('.attr_size').length;
                    var i = 0;
                    var blankLen = 0;
                    for(i=0;i<len;i++){
                        if($.trim($('.attr_size').eq(i).val()) == ''){
                            blankLen++;
                        }
                    }
                    var attrArr = [];
                    for(i=0;i<len;i++){
                        if($.trim($('.attr_size').eq(i).val()) != ""){
                            attrArr.push($.trim($('.attr_size').eq(i).val()));
                        }
                    }
                    uniAttr = unique(attrArr);
                    uniLen = uniAttr.length;
//                    alert("uniLen" + uniLen + "    len  " + len + ' blankLen' + blankLen)
                    if(len - blankLen > uniLen){
                        alert('请删除重复的商品尺码.')
                        return true;
                    }else{
                        return false;
                    }

                }

                $("#add_attr").click(function () {
                    var tr = $('#attr_tbody tr').eq(0).html();
                    $('#attr_tbody').append('<tr>'+tr+'</tr>');
                });//#add_attr click end


                $('#attr_tbody').on('click','.attr_close',function() {
                    if(!confirm('确定要删除该尺码吗')){
                        return false;
                    }
                    if($('.attr_close').length < 2){
                        alert('请保留至少一个尺码');
                        return false;
                    }
                    $(this).parent().parent().remove()
                });//#attr_tbody click end




                
                $("#m_form").submit(function(){
                    if(isAttrSame()){
                        return false;
                    }
                });
            });//ready end

        </script>
